package com.yanqu.road.server.logic.activity.relation.condition;

import com.yanqu.road.entity.activity.ActivityConditionInfo;
import com.yanqu.road.entity.enums.eGamePlayerEventType;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.task.TaskModule;
import com.yanqu.road.server.logic.activity.relation.RelationActivityData;

import java.math.BigInteger;

public class CookBoy1MakeFoodTimesCondition extends BaseRelationActivityRankCondition {

    public CookBoy1MakeFoodTimesCondition(GamePlayer player, RelationActivityData activityData, ActivityConditionInfo conditionInfo) {
        super(player, activityData, conditionInfo);
    }

    @Override
    public void addTrigger(GamePlayer player) {
        player.getModule(TaskModule.class).getGameEvent().addListener(eGamePlayerEventType.CookBoy1MakeFoodFinishCount.getValue(), handle);
    }

    @Override
    public void removeTrigger(GamePlayer player) {
        player.getModule(TaskModule.class).getGameEvent().removeListener(eGamePlayerEventType.CookBoy1MakeFoodFinishCount.getValue(), handle);
    }

    @Override
    public boolean isCompleted(GamePlayer player) {
        return false;
    }

    @Override
    protected void player_BoardLevelHandle(Object object) {
        int times = (int) object;
        setValue(BigInteger.valueOf(times));
    }
}
